﻿<%@ Page Language="C#" MasterPageFile="~/InventoryTracker/MasterPage.master" AutoEventWireup="true" CodeFile="View.aspx.cs" Inherits="InventoryTracker_View" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">


<div id="projectreport">
        <a name="content_start0" id="content_start0"></a>
        <fieldset>
        <h2 class="none">
            View Master</h2>
        <legend>View Information</legend>
        <div class="formsection">
            View</div>
     
     <table>
      <tr>
      <td>
      <asp:Label ID="lblInvNo" runat="server" Text="Invoice Number"></asp:Label>
      <br />
      <asp:TextBox ID="txtInvNo" runat="server" Enabled="true"></asp:TextBox>
      </td>
      </tr>
     
      <tr>
      <td>
      <asp:Label ID="lblCustoInfo" runat="server" Text="Customer Information"></asp:Label>
      <br />
      <asp:DropDownList ID="DdlCustoInfo" runat="server" AutoPostBack="True" 
              DataSourceID="SqlDSCustInfo" DataTextField="CustName" DataValueField="CustID" 
              onselectedindexchanged="DdlCustoInfo_SelectedIndexChanged"></asp:DropDownList>
      <asp:SqlDataSource ID="SqlDSCustInfo" runat="server" 
              ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
              SelectCommand="SELECT [CustID], [CustName] FROM [CustomerMaster]">
      </asp:SqlDataSource>
      </td>
     
      <td>
      <asp:Button ID="btnAddCust" runat="server" Text="New" onclick="btnAddCust_Click"></asp:Button>
      </td>
      </tr>
      </table>
     
      <table>
           <asp:Label ID="CustInfoLabel" runat="server" Text="Customer Information:" 
                Font-Bold="True" Font-Underline="True"></asp:Label>
       <tr>
       <td>
           <asp:Label ID="CustInfLabel" runat="server" Font-Bold="True"></asp:Label>
       </td>
       <td>
           <asp:Label ID="CustLabel" runat="server"></asp:Label>
       </td>
       </tr>
       </table>    
       <table style="top: 72px; left: 1009px; position: absolute; height: 108px; width: 136px; ">
       <tr>
       <td>
         <p >
            <asp:Label ID="lblDateTime" runat="server" Text="Date"></asp:Label>
            <br />
            <asp:TextBox ID="txtDateTime" runat="server" 
            ontextchanged="txtDateTime_TextChanged" AutoPostBack="True" 
            Enabled="False"></asp:TextBox>
         </p>

       <p style="height: 44px; width: 127px" >
             <asp:Label ID="lblPlace" runat="server" Text="Place"></asp:Label>
             
             <br />                
             <asp:TextBox ID="txtPlace" runat="server" ontextchanged="txtPlace_TextChanged"></asp:TextBox>
            </p>
                        
       </td>
       </tr>
       </table>

    <div>
        <table cellpadding="0" cellspacing="0" style="width: 868px">
        <tr>
                <td style="width: 100px; height: 19px;">
                    Invoice Number</td>
                <td style="width: 100px; height: 19px;">
                    Item Name</td>
                <td style="width: 100px; height: 19px;">
                    Description</td>
                <td style="width: 100px; height: 19px;">
                    Rate</td>
                <td style="width: 100px; height: 19px;">
                    Quantity
                    <asp:Label ID="lblAvail" runat="server"></asp:Label>
                    </td>
                <td style="width: 100px; height: 19px;">
                    Total Amount</td>
              
        </tr>
        <tr>
                <td style="width: 100px">
                    &nbsp;</td>
            
                <td style="width: 100px">
                    <asp:DropDownList ID="DdlItName" runat="server" DataSourceID="SqlDSItemName" 
                        DataTextField="ItemName" DataValueField="ItemCode" AutoPostBack="True" 
                        onselectedindexchanged="DdlItName_SelectedIndexChanged"></asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDSItemName" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="SELECT [ItemCode], [ItemName] FROM [MaterialMaster]">
                    </asp:SqlDataSource>
                </td>
                <td style="width: 100px">
                
                    <asp:TextBox ID="txtDes" runat="server"  Enabled="false"></asp:TextBox>
                </td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtRate" runat="server" Enabled="false"/></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtQty" runat="server"  OnTextChanged="txtTotAmt_TextChanged" AutoPostBack="true"/></td>
                <td style="width: 100px">
                    <asp:TextBox ID="txtTotAmt" runat="server" Enabled="false" /></td>
                
                <td style="width: 100px">
                    <asp:Button ID="btnAddNew" runat="server" Text="Add New" onclick="btnAddNew_Click" 
                         /></td>
            </tr>
        </table>
       
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            ShowFooter="True" CellPadding="4" ForeColor="#333333" GridLines="None" 
            onrowcancelingedit="GridView1_RowCancelingEdit" 
             onrowediting="GridView1_RowEditing" 
            onrowupdating="GridView1_RowUpdating" AllowPaging="True"
            onpageindexchanging="GridView1_PageIndexChanging" 
            onrowdeleting="GridView1_RowDeleting1" 
            onselectedindexchanged="GridView1_SelectedIndexChanged" style="Width:57%" 
            Width="777px" EnableSortingAndPagingCallbacks="True">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" Wrap="True" />
        <Columns>
        <asp:BoundField DataField="InvoiceNumber" HeaderText="No" ReadOnly="true" Visible="true"/>
            <asp:BoundField DataField="InvoiceItem" HeaderText="Name" />
            <asp:BoundField DataField="ItemDescription" HeaderText="Description"/>
            <asp:BoundField DataField="InvoiceItemRate" HeaderText="Rate"/>
            <asp:BoundField DataField="InvoiceItemQty" HeaderText="Quantity" />
            <asp:BoundField DataField="InvoiceTotalAmount" HeaderText="TotalAmount"/>
            
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            
        </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
                HorizontalAlign="Center" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
    </div>
    
    
    <table  style="width:57%"  >
<tr>
<td align="right" style="width:80%">
    <asp:Label ID="DiscountLabel" runat="server" Text="Discount:" Font-Bold="True"></asp:Label>
</td>
<td>
<asp:TextBox ID="DiscountTextBox" runat="server" 
        onselectedindexchanged="DDRTax_SelectedIndexChanged" ></asp:TextBox>
<asp:Label ID="lblInvPerSymbol" runat="server" Text="%"></asp:Label>
  
  
</td>
</tr>
<tr>
<td  align="right" style="width:80%">
<asp:Label ID="TaxLabel" runat="server" Text="Tax:" Font-Bold="True"></asp:Label>  
</td>
<td>
<asp:DropDownList ID="DDRTax" runat="server" DataSourceID="TaxDS" 
        DataTextField="TaxName" DataValueField="TaxPercent" 
        onselectedindexchanged="DDRTax_SelectedIndexChanged" AutoPostBack="True" 
        Height="22px" Width="128px"></asp:DropDownList>
    <asp:SqlDataSource ID="TaxDS" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [TaxScheme]"></asp:SqlDataSource>

</td>

</tr>
<tr>
<td align="right" style="width:80%" >
<asp:Label ID="TaxRsLabel" runat="server" Text="Rs:" Font-Bold="True"></asp:Label>
</td>
<td >


<asp:TextBox ID="TaxTextBox" runat="server" 
        ontextchanged="TaxTextBox_TextChanged" AutoPostBack="True"  ></asp:TextBox>
 </td>
 </tr>       
<tr>
<td align="right" style="width:81%">
   <asp:Label ID="GrandTotalLabel" runat="server" Text="Grand Total:" 
        Font-Bold="True"></asp:Label>
</td>
<td>
<asp:TextBox ID="GrandTotalTextBox" runat="server" 
        ontextchanged="GrandTotalTextBox_TextChanged" AutoPostBack="True" 
        ></asp:TextBox>
  
  
</td>
</tr>
 
</table>

    
      
                
        <div class="formsection">
        <asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click"/>
        
        <asp:Label ID="lblResult" runat="server" Text=""></asp:Label>
        </div>
        </fieldset>
    </div>

</asp:Content>

